/**
 * 2025/01/01 - 2025/12/31
 */
package com.snail.starter.db.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import com.snail.starter.db.annotation.mapstruct.ToManOrWoman;
import lombok.Getter;
import lombok.ToString;

/**
 * @author zgadmin
 * @date 2025/7/1 16:31
 */
@Getter
@ToString
public enum ManOrWomanEnum implements IEnum<Integer> {

    WOMAN(0, "女"),
    MAN(1, "男"),
    ;

    private final Integer value;

    private final String desc;

    ManOrWomanEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @ToManOrWoman
    public static ManOrWomanEnum getEnum(Integer value) {
        return null != value && 1 == value ? MAN : WOMAN;
    }
}